package com.hdu.dwh.service.flink_service;

import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

import com.hdu.dwh.pojos.FlinkJob;

@Service
@HttpExchange(url="/v1/sessions")
public interface FlinkSQLRestService {
    
    @PostExchange(url="/")
    Map<String, Object> connect();

    @PostExchange(url="/{sessionId}/statements/")
    Map<String, Object> executeFlinkSQL(@PathVariable String sessionId,@RequestBody Map<String, String> sql);

    @GetExchange(url="{sessionHandle}/operations/{operationHandle}/result/{resId}")
    Map<String, Object> getFlinkSQLResult(@PathVariable String sessionHandle,@PathVariable String operationHandle,@PathVariable Integer resId);

}
